import { stringify } from "qs";
import request from "@/utils/request";

export async function UserList(params) {
  return request(`/admin/query`, {
    method: "POST",
    body: {
      ...params
    }
  });
}

export async function removeUser(params) {
  return request(`/admin/del/${params.key}`, {
    method: "POST",
    body: {}
  });
}

export async function addUser(params) {
  return request("/admin/add", {
    method: "POST",
    body: {
      ...params
    }
  });
}

export async function editUser(params) {
  return request("/admin/edit", {
    method: "POST",
    body: {
      ...params,
      method: "update"
    }
  });
}

export async function deptQuery(params) {
  return request("/dept/query", {
    method: "POST",
    body: params
  });
}

export async function userDetail(params) {
  console.log('desc',params);
  return request(`/admin/detail/${params.adminNo}`, {
    method: "POST",
    body:{}
  });
}
export async function permissionRole(params) {
  return request("/permission/role/bind", {
    method: "POST",
    body: params
  });
}
export async function enterpriseList(params) {
  return request("/admin/enterprise/list", {
    method: "POST",
    body: params
  });
}
export async function adminEnterprise(params) {
  return request("/admin/enterprise/bind", {
    method: "POST",
    body: params
  });
}
